#include <stdio.h>

int 
main(void)
{
    double loan, rate, m_rate, m_payment, balance;
    double first, second, third;

    puts("Enter amount of loan:");
    scanf("%lf", &loan);

    puts("Enter interest rate:");
    scanf("%lf", &rate);

    puts("Enter monthly payment:");
    scanf("%lf", &m_payment);

    m_rate = (rate/12.00)/100.00;

    balance = loan * m_rate;
    first = loan - m_payment + balance;
    second = first - m_payment + balance;
    third = second - m_payment + balance;

    printf("Balance remaining after:\nFirst payment: %0.2lf\n Second payment: %0.2lf\nThird payment:%0.2lf\n", 
            first, second, third);

    return 0;
}   
